package com.huasan.www.demon.data.service.impl;
import com.huasan.www.demon.util.OnePage;
import com.huasan.www.demon.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huasan.www.demon.data.dao.OperatorsMapper;
import com.huasan.www.demon.data.service.OperatorsService;

import com.huasan.www.demon.pojo.Operators;
import com.huasan.www.demon.pojo.OperatorsExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

@Service("operatorsService")
public class OperatorsServiceImpl implements OperatorsService{
	
    @Autowired
    private OperatorsMapper operatorsDao;    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int countByExample(OperatorsExample example){
      return operatorsDao.countByExample(example);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int deleteByExample(OperatorsExample example){
      return operatorsDao.deleteByExample(example);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int deleteByPrimaryKey(Long id){
      return operatorsDao.deleteByPrimaryKey(id);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int insert(Operators record){
      return operatorsDao.insert(record);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int insertSelective(Operators record){
      return operatorsDao.insertSelective(record);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public List<Operators> selectByExample(OperatorsExample example){
      return operatorsDao.selectByExample(example);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public Operators selectByPrimaryKey(Long id){
      return operatorsDao.selectByPrimaryKey(id);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int updateByExampleSelective(@Param("record") Operators record, @Param("example") OperatorsExample example){
      return operatorsDao.updateByExampleSelective(record,example);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int updateByExample(@Param("record") Operators record, @Param("example") OperatorsExample example){
      return operatorsDao.updateByExample(record,example);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int updateByPrimaryKeySelective(Operators record){
      return operatorsDao.updateByPrimaryKeySelective(record);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table operators
     *
     * @mbggenerated Tue Jan 21 00:35:22 CST 2014
     */
    public int updateByPrimaryKey(Operators record){
      return operatorsDao.updateByPrimaryKey(record);
    }

    public OnePage<Operators> selectOnePageByExample(OperatorsExample example){
    	int count = operatorsDao.countByExample(example);
    	List<Operators> dataList = operatorsDao.selectByExample(example);
    	OnePage<Operators> onepage = new OnePage<Operators>();
    	onepage.setPage(new Page(example.getLimitStart(), example.getLimitEnd()));
    	onepage.getPage().setCount(count);
    	onepage.setDataList(dataList);
    	return onepage;
    }
}